
const {Service}=require('egg');

class userlistService extends Service{
    async index(){
        let sql=`select * from user `;
        return this.app.mysql.query(sql);
    };
    async create({id,username,nickname,sex}){
        let sql=`insert into user (user_id,username,nickname,sex) values(?,?,?,?)`;
        return await this.app.mysql.query(sql,[id,username,nickname,sex]);
    }
};
module.exports = userlistService;